<%
PCnt=15
ModPCnt=(objRecordset.pagecount mod cint(PCnt))

if Request.QueryString("nom")<>empty then
	if Request.QueryString("nom")<1 then
	page=1
	else
	page=Request.QueryString("nom")
	end if
else
page=1
end if
objRecordset.AbsolutePage = CLng(page)

if objRecordset.pagecount>cint(PCnt) then
	if cint(page)>objRecordset.pagecount then
		page=objRecordset.pagecount
		objRecordset.absolutepage=clng(page)
		FirstP=cint(objRecordset.pagecount)-cint(PCnt)
		LastP=objRecordset.pagecount
		aPrev="<a href='AutomatLogList_extra.asp?names="&DataS&"&namepo="&DataPo&"&Direction=Nom&nom=1"&sUri&sUri2&sUri3&list&status11&status1&acs&"'>1 </a>&nbsp;<a href='AutomatLogList_extra.asp?names="&DataS&"&namepo="&DataPo&"&Direction=Nom&nom="&(objRecordset.pagecount-cint(ModPCnt))&sUri&sUri2&sUri3&list&status1&acs&"'>...Prev...</a>"
		aNext=""
	else
		if cint(page)<1 then
			page=1
			FirstP=1
			LastP=cint(PCnt)
			objRecordset.absolutepage=1
			aPrev=""
			aNext="<a href='AutomatLogList_extra.asp?names="&DataS&"&namepo="&DataPo&"&Direction=Nom&nom="&(LastP)&sUri&sUri2&sUri3&list&status1&acs&"'>...Next...</a>&nbsp;<a href='AutomatLogList_extra.asp?names="&DataS&"&namepo="&DataPo&"&Direction=Nom&nom="&(objRecordset.pagecount)&sUri&sUri2&sUri3&list&status1&acs&"'>"&objRecordset.pagecount&"</a>"					
		else
			if cint(page)=>(cint(objRecordset.pagecount)-cint(ModPCnt)) then
				FirstP=(cint(objRecordset.pagecount)-cint(ModPCnt))
				LastP=cint(objRecordset.pagecount)
				aPrev="<a href='AutomatLogList_extra.asp?names="&DataS&"&namepo="&DataPo&"&Direction=Nom&nom=1"&sUri&sUri2&sUri3&list&status1&acs&"'>1 </a>&nbsp;<a href='AutomatLogList_extra.asp?names="&DataS&"&namepo="&DataPo&"&Direction=Nom&nom="&(cint(FirstP)-cint(PCnt)+1)&sUri&sUri2&sUri3&list&status1&acs&"'>...Prev...</a>"
				aNext=""
			else
				FirstP=(cint(page)-(cint(page) mod cint(PCnt)))
				LastP=FirstP+cint(PCnt)
				aPrev="<a href='AutomatLogList_extra.asp?names="&DataS&"&namepo="&DataPo&"&Direction=Nom&nom=1"&sUri&sUri2&sUri3&list&status1&acs&"'>1 </a>&nbsp;<a href='AutomatLogList_extra.asp?names="&DataS&"&namepo="&DataPo&"&Direction=Nom&nom="&(cint(FirstP)-cint(PCnt))&sUri&sUri2&sUri3&list&status1&acs&"'>...Prev...</a>"	
				aNext="<a href='AutomatLogList_extra.asp?names="&DataS&"&namepo="&DataPo&"&Direction=Nom&nom="&(LastP)&sUri&sUri2&sUri3&list&status1&acs&"'>...Next...</a>&nbsp;<a href='AutomatLogList_extra.asp?names="&DataS&"&namepo="&DataPo&"&Direction=Nom&nom="&(objRecordset.pagecount)&sUri&sUri2&sUri3&list&status1&acs&"'>"&objRecordset.pagecount&"</a>"
				if 	FirstP<1 then
					FirstP=1
					LastP=cint(PCnt)
					aPrev=""	
					aNext="<a href='AutomatLogList_extra.asp?names="&DataS&"&namepo="&DataPo&"&Direction=Nom&nom="&(LastP)&sUri&sUri2&sUri3&list&status1&acs&"'>...Next...</a>&nbsp;<a href='AutomatLogList_extra.asp?names="&DataS&"&namepo="&DataPo&"&Direction=Nom&nom="&(objRecordset.pagecount)&sUri&sUri2&sUri3&list&status1&acs&"'>"&objRecordset.pagecount&"</a>"
				end if		
				if LastP=>cint(objRecordset.pagecount) then
					FirstP=(cint(objRecordset.pagecount)-cint(ModPCnt))
					LastP=cint(objRecordset.pagecount)
					page=objRecordset.pagecount
					objRecordset.absolutepage=clng(page)
					aPrev="<a href='AutomatLogList_extra.asp?names="&DataS&"&namepo="&DataPo&"&Direction=Nom&nom=1"&sUri&sUri2&sUri3&list&status1&acs&"'>1</a>&nbsp;<a href='AutomatLogList_extra.asp?names="&DataS&"&namepo="&DataPo&"&Direction=Nom&nom="&((cint(FirstP)-cint(PCnt))+strCh)&sUri&sUri2&sUri3&list&status1&acs&"'>...Prev...</a>"
					aNext=""
				end if
			end if
		end if
	end if
else
	FirstP=1
	LastP=objRecordset.pagecount
	aPrev="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
	aNext=""
end if

		q=FirstP
		response.write aPrev
	  for q=FirstP to LastP
	  	if q<>cint(page) then%>
		<a href="AutomatLogList_extra.asp?names=<%=DataS%>&namepo=<%=DataPo%>&Direction=Nom&nom=<%=q%><%=sUri%><%=sUri2%><%=sUri3%><%=list%><%=status1%><%=acs%>"><%=q%></a>
		<% 		
		else
		response.write "&nbsp;<font color=#660000><b>["&q&"]</b></Font>&nbsp;"
		end if
	  Next
		response.write aNext
%>



